{include file="common/head"}
<title>广告位新增</title>

  <link rel="stylesheet"    href="https://cdnjs.cloudflare.com/ajax/libs/jodit/3.24.2/jodit.es2018.min.css"/>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/jodit/3.24.2/jodit.es2018.min.js"></script>   
</head>
<body>
    <div class="container p-3 my-3 " style="max-width: 600px;">
    <h2>广告位新增</h2>

    <form method="post" action="/index.php/goods/goods_add" enctype="multipart/form-data">
       <div class="mb-3 row">
        <div class="col-2">
          <lable for="fid" class="form-label">分类: </label>
        </div>
        <div class="col-10">
          <select id="cat_id" name="cat_id" class="form-control">
              {foreach $cats as $k=>$v}
                <option value="{$k}" style="font-weight: bold" >
                    {if $v['deepth']==1}
                        ├─
                    {elseif $v['deepth']==2}
                        &nbsp;&nbsp;&nbsp;&nbsp;├─
                    {elseif $v['deepth']==3}
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;├─
                    {/if}

                {$v['name']}</option>
              {/foreach}
          </select>
        </div>
      </div>

      <div class="mb-3 row">
        <div class="col-2"><label for="name" class="form-label">名称:</label></div>
        <div class="col-10"><input type="text" class="form-control" id="name" name="name" value="" placeholder="name"/></div>
      </div>
  
      <div class="mb-3 row">
        <div class="col-2">
          <label for="desc" class="form-label">产品说明:</label>
        </div>
        <div class="col-10">
          <input type="text" class="form-control" id="desc" name="desc" value="" placeholder="Description" />
        </div>
      </div>      

     <div class="mb-3 row">
        <div class="col-2">
        <label for="price" class="form-label">标准价格:</label>
        </div>
        <div class="col-10">
        <input type="number" class="form-control" id="price" name="price" value="" placeholder="Price" />          
        </div>      

      </div>

      <div class="mb-3">
        <label for="status" class="form-label">是否启用:</label>
          <input type="radio" class="form-check-input" id="radio1" name="status" value="1" checked /> 
          <label class="form-check-label" for="radio1">上架</label>
          <input type="radio" class="form-check-input" id="radio2" name="status" value="2" />
          <label class="form-check-label" for="radio2">下架</label>
          <input type="radio" class="form-check-input" id="radio3" name="status" value="3" />
          <label class="form-check-label" for="radio3">作废</label>
       </div>

      <button  type="button" class="btn btn-primary" onclick="doSave()">保存(Save)</button>
    </form>
    </div>

  <script type="text/javascript">
    function doSave(){
      if(!$("#name").val() || !$("#price").val() ){
        layer.msg("别瞎闹！",function(){});
        $("#discount").val(1);
        return false;
      }
      $('form').submit();
    }

    var editor = Jodit.make('#content',{
      toolbarButtonSize: 'small',
      language: 'zh_cn',
    });

    $(document).ready(function(){

    })
  </script>


</body>
</html>
